Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move returns before goto when applicable. #4774

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Jan 9, 2024

This change is Reviewable

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-lowering/src/optimizations/return_optimization.rs line 192 at r1 (raw file):

                return_vars.pop();
                return_vars.push(*remapped_return);
                self.fixes.push(FixInfo { block_id, return_vars });

This could be done when any of the returned variables is remapped.

Code quote:

                let mut return_vars = returned_vars.to_vec();
                return_vars.pop();
                return_vars.push(*remapped_return);
                self.fixes.push(FixInfo { block_id, return_vars });

@ilyalesokhin-starkware ilyalesokhin-starkware force-pushed the ilya/returned_opt branch 2 times, most recently from a7856a0 to d827fdf Compare January 9, 2024 11:56
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 91 of 96 files at r1, 4 of 4 files at r2, 9 of 9 files at r3.
Reviewable status: 104 of 105 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-lowering/src/db.rs line 377 at r2 (raw file):

    return_optimization(db, &mut lowered);

    // optimize_remappings(&mut lowered);

?

Copy link
Contributor Author

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 104 of 105 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-lowering/src/db.rs line 377 at r2 (raw file):

Previously, orizi wrote…

?

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Jan 9, 2024
Merged via the queue into main with commit 14edeca Jan 9, 2024
38 checks passed
@orizi orizi deleted the ilya/returned_opt branch January 15, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants